<template>
  <div>
    <site-nav />
    <head-item />
    <DetailItem :detailData='detailData'/>
    <advantage-item />
    <guide-item />
    <friendly-link />
    <footer-item />
  </div>
</template>

<script>
import HeadItem from '../../layout/Header'
import SiteNav from '../../layout/Nav'
import AdvantageItem from '../../layout/Advantage'
import FooterItem from '../../layout/Footer'
import GuideItem from '../../layout/Guide'
import FriendlyLink from '../../layout/FriendlyLink'
import DetailItem from './components/DetailItem'
import { getPersonalMsgDetail, getSysMsgDetail } from '@/api/message/message'
export default {
  name: 'MessageCenterDetail',
  components: {
    HeadItem,
    SiteNav,
    AdvantageItem,
    FooterItem,
    GuideItem,
    FriendlyLink,
    DetailItem
  },
  data() {
    return {
      detailData: {}
    }
  },
  async created() {
    if(this.$route.query.type==0){
    const detailData = await getPersonalMsgDetail(this.$route.query.id)
    this.detailData=detailData.data
    console.log(this.detailData);
    }else{
     const detailData = await getSysMsgDetail(this.$route.query.msgGroupId)
      this.detailData=detailData.data
    }
   
  }
}
</script>

<style scoped lang="scss">

</style>
